/*
 * $Id: UiRequestList.java,v 1.4 2009/12/16 18:00:27 navdeep_mahajan Exp $
 * 
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 * 
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */
package com.ge.healthcare.autosc.ui.pojo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.ge.healthcare.autosc.common.ASCUtil;
import com.ge.healthcare.autosc.common.database.pojo.ActRequestList;
import com.ge.healthcare.autosc.common.database.pojo.CfgRequestType;
import com.ge.healthcare.autosc.common.util.TimeFormatStandard;

public class UiRequestList extends AscUiObject {
	private Long requestListId;
	private Long requestTypeId;
	private Long batchId;
	private String enterDate;
	private String scheduledDate;
	private Long passCount;
	private Long failCount;
	private Long validCount;
	private Long invalidCount;
	
	private String requestTypeName;
	
	private List<UiRqUser> users;
	private List<UiRequest> requests;
	public UiRequestList(){
		
	}
	public UiRequestList(ActRequestList rqList){
		users = new ArrayList<UiRqUser>();
		requests = new ArrayList<UiRequest>();
		load(rqList);
	}
	public void load(CfgRequestType rqType){
		this.requestTypeId = rqType.getRequestTypeId();
		this.requestTypeName = rqType.getRequestTypeName();
	}
	public void load(ActRequestList rqList){
		this.requestListId = rqList.getRequestListId();
		this.requestTypeId = rqList.getRequestTypeId();
		this.batchId  = rqList.getBatchId();
		setEnterDate(rqList.getEnterDate());
		setScheduledDate(rqList.getScheduledDate());
		this.passCount = rqList.getPassCount();
		this.failCount = rqList.getFailCount();
		this.validCount  = rqList.getValidCount();
		this.invalidCount  = rqList.getInvalidCount();
	}
	/**
	 * @return the requestListId
	 */
	public Long getRequestListId() {
		return requestListId;
	}

	/**
	 * @param requestListId the requestListId to set
	 */
	public void setRequestListId(Long requestListId) {
		this.requestListId = requestListId;
	}

	/**
	 * @return the requestTypeId
	 */
	public Long getRequestTypeId() {
		return requestTypeId;
	}

	/**
	 * @param requestTypeId the requestTypeId to set
	 */
	public void setRequestTypeId(Long requestTypeId) {
		this.requestTypeId = requestTypeId;
	}

	/**
	 * @return the batchId
	 */
	public Long getBatchId() {
		return batchId;
	}

	/**
	 * @param batchId the batchId to set
	 */
	public void setBatchId(Long batchId) {
		this.batchId = batchId;
	}

	/**
	 * @return the enterDate
	 */
	public String getEnterDate() {
		return enterDate;
	}

	/**
	 * @param enterDate the enterDate to set
	 */
	public void setEnterDate(String enterDate) {
		this.enterDate = enterDate;
	}
	/**
	 * @param date
	 */
	public void setEnterDate(Date date) {
		if (!ASCUtil.isNullOrEmptyObject(date)) {
			this.enterDate = TimeFormatStandard.getDtInEndUserDisplayFormat(date);
		}
	}
	
	/**
	 * @return the scheduledDate
	 */
	public String getScheduledDate() {
		return scheduledDate;
	}

	/**
	 * @param scheduledDate the scheduledDate to set
	 */
	public void setScheduledDate(String scheduledDate) {
		this.scheduledDate = scheduledDate;
	}
	
	/**
	 * @param date
	 */
	public void setScheduledDate(Date date) {
		if (!ASCUtil.isNullOrEmptyObject(date)) {
			this.scheduledDate = TimeFormatStandard.getDtInEndUserDisplayFormat(date);
		}
	}
	

	/**
	 * @return the passCount
	 */
	public Long getPassCount() {
		return passCount;
	}

	/**
	 * @param passCount the passCount to set
	 */
	public void setPassCount(Long passCount) {
		this.passCount = passCount;
	}

	/**
	 * @return the failCount
	 */
	public Long getFailCount() {
		return failCount;
	}

	/**
	 * @param failCount the failCount to set
	 */
	public void setFailCount(Long failCount) {
		this.failCount = failCount;
	}

	/**
	 * @return the validCount
	 */
	public Long getValidCount() {
		return validCount;
	}

	/**
	 * @param validCount the validCount to set
	 */
	public void setValidCount(Long validCount) {
		this.validCount = validCount;
	}

	/**
	 * @return the invalidCount
	 */
	public Long getInvalidCount() {
		return invalidCount;
	}

	/**
	 * @param invalidCount the invalidCount to set
	 */
	public void setInvalidCount(Long invalidCount) {
		this.invalidCount = invalidCount;
	}

	/**
	 * @return the requestTypeName
	 */
	public String getRequestTypeName() {
		return requestTypeName;
	}

	/**
	 * @param requestTypeName the requestTypeName to set
	 */
	public void setRequestTypeName(String requestTypeName) {
		this.requestTypeName = requestTypeName;
	}

	/**
	 * @return the users
	 */
	public List<UiRqUser> getUsers() {
		return users;
	}

	/**
	 * @param users the users to set
	 */
	public void setUsers(List<UiRqUser> users) {
		this.users = users;
	}
	public void addUser(UiRqUser user){
		this.users.add(user);
	}
	/**
	 * @return the requests
	 */
	public List<UiRequest> getRequests() {
		return requests;
	}
	/**
	 * @param requests the requests to set
	 */
	public void setRequests(List<UiRequest> requests) {
		this.requests = requests;
	}
	
	public void addRequest(UiRequest request){
		this.requests.add(request);
	}
}
